OCAML :=@OCAML@
MERCURIAL :=@MERCURIAL@

.PHONY: clean distclean version

../src/version.cmo: ../src/version.ml
	$(MAKE) -C ../src version.cmo

../src/buildNumber.ml:
	$(MAKE) -C ../src buildNumber.ml 

../src/buildNumber.cmo: ../src/buildNumber.ml
	$(MAKE) -C ../src buildNumber.cmo

../src/compileFlags.ml:
	$(MAKE) -C ../src compileFlags.ml 

../src/compileFlags.cmo: ../src/compileFlags.ml
	$(MAKE) -C ../src compileFlags.cmo

version.tex: ../src/compileFlags.cmo ../src/buildNumber.cmo ../src/version.cmo makeVersion.ml
	$(OCAML) -noprompt str.cma ../src/compileFlags.cmo ../src/buildNumber.cmo  ../src/version.cmo -I ../src/ makeVersion.ml > version.tex

version: ../src/compileFlags.cmo ../src/buildNumber.cmo ../src/version.cmo makeVersion.ml
	$(OCAML) -noprompt str.cma ../src/compileFlags.cmo ../src/buildNumber.cmo  ../src/version.cmo -I ../src/ makeVersion.ml -text

QuickStart.pdf: QuickStart.tex
	pdflatex $<
	pdflatex $<
	pdflatex $< 

commands.pdf: commands.tex allcommands.tex poy3commands.tex  QuickStart.tex poylibrary.bib poyheuristics.tex version.tex
	pdflatex commands.tex
	bibtex commands
	pdflatex commands.tex
	pdflatex commands.tex
	makeindex general
	makeindex poy3 
	pdflatex commands.tex

clean:
	rm -f *.aux *.pdf *.log *.idx *.ind *.out *.toc *.ilg *.bbl *.blg

distclean: clean
	rm -f version.tex
	rm -f Makefile
